{$CLEO .qa}
{$USE CLEO+}
{$USE newOpcodes}
{$USE ini}

0000: NOP

script_name "GasP"

// By ArtemQa146

if and
    056E:   car 1@ defined
    0@ == true
then
    0390: load_txd_dictionary "GSMOD"
    038F: load_texture "GSST4" as 1  // Load dictionary with 0390 first
    0E3C: get_texture_from_sprite 1 store_to 31@
    0391: release_textures

    //    
    0E2A: add_cleo_blip 31@ position 357.8 2539.9 is_short 1 RGBA 255 255 255 255 store_to 30@
    0E2A: add_cleo_blip 31@ position 1410.4 1790.9 is_short 1 RGBA 255 255 255 255 store_to 29@
    0E2A: add_cleo_blip 31@ position 1434.4 -2453.4 is_short 1 RGBA 255 255 255 255 store_to 28@
    0E2A: add_cleo_blip 31@ position -1164.0 -199.5 is_short 1 RGBA 255 255 255 255 store_to 27@

    repeat
    wait 0
    if
        80DF:   not actor $PLAYER_ACTOR driving
    then
        break
    end

    //      
    if
        0EEA: locate_char_distance_to_coordinates $PLAYER_ACTOR pos 357.8 2539.9 16.7 radius 200.0
    then
        2@ = 357.8
        3@ = 2539.9
        4@ = 25.7
        gosub @Icon //   
    end

    if
        0EEA: locate_char_distance_to_coordinates $PLAYER_ACTOR pos 1410.4 1790.9 10.8 radius 200.0
    then
        2@ = 1410.4
        3@ = 1790.9
        4@ = 20.8
        gosub @Icon
    end

    if
        0EEA: locate_char_distance_to_coordinates $PLAYER_ACTOR pos 1434.4 -2453.4 13.5 radius 200.0
    then
        2@ = 1434.4
        3@ = -2453.4
        4@ = 25.5
        gosub @Icon
    end

    if
        0EEA: locate_char_distance_to_coordinates $PLAYER_ACTOR pos -1164.0 -199.5 14.1 radius 200.0
    then
        2@ = -1164.0
        3@ = -199.5
        4@ = 25.1
        gosub @Icon
    end


    until not player.Defined(0)

    //          ,     
    0E2B: remove_cleo_blip 30@
    0E2B: remove_cleo_blip 29@
    0E2B: remove_cleo_blip 28@
    0E2B: remove_cleo_blip 27@
end

0A93: terminate_this_custom_script //  


:Icon
    if
        0EEA: locate_char_distance_to_coordinates $PLAYER_ACTOR pos 2@ 3@ 4@ radius 200.0
    then
        if
            0E3F: convert_3d_to_screen_2d 2@ 3@ 4@ checkNearClip 1 checkFarClip 1 store_2d_to 5@ 6@ size_to 7@ 7@
        then
            0EB2: get_offset_from_camera_in_world_coords 0 0 0 store_to 8@ 9@ 10@ //    
            050A: 8@ = distance_between_XYZ 2@ 3@ 4@ and_XYZ 8@ 9@ 10@ //     

            // 
            0087: 10@ = 8@ // (float)
            10@ *= 3.5
            if 10@ <= 150.0
            then 10@ = 150.0
            end
            006B: 7@ *= 10@  // (float)

            // 
            8@ *= 1.5
            0092: 8@ = float 8@ to_integer
            9@ = 255
            0062: 9@ -= 8@  // (int)
            if 9@ < 0
            then 9@ = 0
            end
            if 9@ > 100
            then 9@ = 100
            end

            0E1E: draw_texture_plus 31@ event 1 pos 5@ 6@ size 7@ 7@ angle 0.0 depth 0 fix_aspect_ratio 1 maskTrisCount 0 maskTrisArray 0 rgba 255 255 255 9@
        end
    end
return
